package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.Reservation;
import com.zzyl.vo.ReservationVo;
import com.zzyl.vo.TimeCountVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @Description CustomerReservationMapper
 * @Author Lwj
 * @Date 2024-08-31-16:31
 */
@Mapper
public interface CustomerReservationMapper {
    /**
     * 查询取消预约数量
     *
     * @return
     */
    Integer getCount(@Param("startTime") java.time.LocalDateTime startTime,
                  @Param("endTime") java.time.LocalDateTime endTime,
                  @Param("updateBy") Long updateBy);


    /**
     * 查询每个时间段剩余预约次数
     * @param startTime
     * @param endTime
     * @return
     */
    List<TimeCountVo> countBytime(LocalDateTime startTime, LocalDateTime endTime);

    /**
     * 新增预约
     * @param reservation
     */
    void insert(Reservation reservation);

    /**
     * 分页查询
     * @param name
     * @param status
     * @return
     */
    Page<ReservationVo> selectgetPage(String name, Integer status);

    /**
     * customerReservationMapper
     * @param id
     */
    void update(Long id,Integer status);

}
